
Obj/arch_crt0.o:     file format elf32-csky-little


Disassembly of section .text:

00000000 <vector_table>:
	...
 100:	00000006 	.long	0x00000006

00000104 <__start>:
.text
.export __start
//  .long __start
__start:
  //initialize all registers
  movi r0, 0
 104:	3000      	movi      	r0, 0
  movi r1, 0
 106:	3100      	movi      	r1, 0
  movi r2, 0
 108:	3200      	movi      	r2, 0
  movi r3, 0
 10a:	3300      	movi      	r3, 0
  movi r4, 0
 10c:	3400      	movi      	r4, 0
  movi r5, 0
 10e:	3500      	movi      	r5, 0
  movi r6, 0
 110:	3600      	movi      	r6, 0
  movi r7, 0
 112:	3700      	movi      	r7, 0
  //movi r13, 0
  //movi r14, 0
  //movi r15, 0

//set VBR
  lrw r2, vector_table
 114:	105b      	lrw      	r2, 0	// 180 <DummyHandler+0x4>
  mtcr r2, cr<1,0>
 116:	c0026421 	mtcr      	r2, cr<1, 0>

//enable EE bit of psr
  mfcr r2, cr<0,0>
 11a:	c0006022 	mfcr      	r2, cr<0, 0>
  bseti r2, r2, 8
 11e:	3aa8      	bseti      	r2, r2, 8
  mtcr r2, cr<0,0>
 120:	c0026420 	mtcr      	r2, cr<0, 0>
//  st.w    r2, (r1,0x4)
//  movi    r2, 0x1
//  st.w    r2, (r1,0x0)

//disable power peak 
  lrw     r1, 0xe000ef90
 124:	1038      	lrw      	r1, 0xe000ef90	// 184 <DummyHandler+0x8>
  movi    r2, 0x0
 126:	3200      	movi      	r2, 0
  st.w    r2, (r1, 0x0)
 128:	b140      	st.w      	r2, (r1, 0)

//initialize kernel stack
  lrw  r7, __kernel_stack
 12a:	10f8      	lrw      	r7, 0	// 188 <DummyHandler+0xc>
  mov r14,r7
 12c:	6f9f      	mov      	sp, r7
  subi r6,r7,0x4
 12e:	5fcf      	subi      	r6, r7, 4
  lrw  r3, 0x40
 130:	3340      	movi      	r3, 64
  subu r4, r7, r3
 132:	5f8d      	subu      	r4, r7, r3
  lrw  r5, 0x0
 134:	3500      	movi      	r5, 0

00000136 <INIT_KERLE_STACK>:
INIT_KERLE_STACK:
  addi r4, 0x4
 136:	2403      	addi      	r4, 4
  st.w r5, (r4)
 138:	b4a0      	st.w      	r5, (r4, 0)
  //cmphs r7, r4
  cmphs r6, r4
 13a:	6518      	cmphs      	r6, r4
  bt  INIT_KERLE_STACK
 13c:	0bfd      	bt      	0x136	// 136 <INIT_KERLE_STACK>

0000013e <__to_main>:
        
__to_main:
  lrw r0,__main
 13e:	1014      	lrw      	r0, 0	// 18c <DummyHandler+0x10>
  jsr r0
 140:	7bc1      	jsr      	r0
  mov r0, r0
 142:	6c03      	mov      	r0, r0
  mov r0, r0
 144:	6c03      	mov      	r0, r0

  lrw r15, __exit
 146:	ea8f0013 	lrw      	r15, 0	// 190 <DummyHandler+0x14>
  lrw r0,main
 14a:	1013      	lrw      	r0, 0	// 194 <DummyHandler+0x18>
  jmp r0
 14c:	7800      	jmp      	r0
  mov r0, r0
 14e:	6c03      	mov      	r0, r0
  mov r0, r0
 150:	6c03      	mov      	r0, r0
  mov r0, r0
 152:	6c03      	mov      	r0, r0
  mov r0, r0
 154:	6c03      	mov      	r0, r0
  mov r0, r0
 156:	6c03      	mov      	r0, r0

00000158 <__exit>:

.export __exit
__exit:

  lrw r4, 0x20003000
 158:	1090      	lrw      	r4, 0x20003000	// 198 <DummyHandler+0x1c>
  //lrw r5, 0x0
  mov r5, r0
 15a:	6d43      	mov      	r5, r0
  st.w r5, (r4)
 15c:	b4a0      	st.w      	r5, (r4, 0)

  mfcr r1, cr<0,0>
 15e:	c0006021 	mfcr      	r1, cr<0, 0>
  lrw  r1, 0xFFFF
 162:	102f      	lrw      	r1, 0xffff	// 19c <DummyHandler+0x20>
  mtcr r1, cr<11,0>
 164:	c001642b 	mtcr      	r1, cr<11, 0>
  lrw     r1, 0xFFF
 168:	102e      	lrw      	r1, 0xfff	// 1a0 <DummyHandler+0x24>
  movi    r0, 0x0
 16a:	3000      	movi      	r0, 0
  st      r1, (r0)
 16c:	b020      	st.w      	r1, (r0, 0)

0000016e <__fail>:

.export __fail
__fail:
  lrw  r1, 0xEEEE
 16e:	102e      	lrw      	r1, 0xeeee	// 1a4 <DummyHandler+0x28>
  mtcr r1, cr<11,0>
 170:	c001642b 	mtcr      	r1, cr<11, 0>
  lrw     r1, 0xEEE
 174:	102d      	lrw      	r1, 0xeee	// 1a8 <DummyHandler+0x2c>
  movi    r0, 0x0
 176:	3000      	movi      	r0, 0
  st      r1, (r0)
 178:	b020      	st.w      	r1, (r0, 0)

0000017a <__dummy>:

__dummy:
  br      __fail
 17a:	07fa      	br      	0x16e	// 16e <__fail>

0000017c <DummyHandler>:

.export DummyHandler
DummyHandler:
  br      __fail
 17c:	07f9      	br      	0x16e	// 16e <__fail>
 17e:	0000      	.short	0x0000
 180:	00000000 	.long	0x00000000
 184:	e000ef90 	.long	0xe000ef90
	...
 198:	20003000 	.long	0x20003000
 19c:	0000ffff 	.long	0x0000ffff
 1a0:	00000fff 	.long	0x00000fff
 1a4:	0000eeee 	.long	0x0000eeee
 1a8:	00000eee 	.long	0x00000eee
